package ink.ykb.demo.permission.service;

import java.util.List;

import ink.ykb.demo.permission.entity.DealerDepartment;
import ink.ykb.demo.permission.entity.UserDealerDepartment;

public interface UserDealerDepartmentService {

  /**
   * 添加用户经销商层级关联配置
   * @param userDealerDepartment
   */
  void add(UserDealerDepartment userDealerDepartment);
  
  /**
   * 删除用户经销商层级关联配置
   * @param userDealerDepartmentId 关联表主键
   */
  void delete(Long userDealerDepartmentId);
  
  /**
   * 更新用户经销商层级
   * @param userId
   * @param dealerDepartmentId
   * @param scope 权限范围
   */
  void update(Long userId,Long dealerDepartmentId,Integer scope);
  
  /**
   * 查询经销商层级关联配置列表
   * @param dealerDepartmentId 经销商层级主键
   * @return
   */
  List<UserDealerDepartment> getByDealerDepartmentId(Long dealerDepartmentId);
  
  /**
   * 获取用户经销商层级关联配置信息
   * @param userDealerDepartmentId
   * @return
   */
  UserDealerDepartment getById(Long userDealerDepartmentId);
  
  /**
   * 根据用户查询经销商
   * @param userId
   * @return
   */
  UserDealerDepartment getByUserId(Long userId);
  
  /**
   * 根据部门ID递归查询所有关联的用户关联配置信息 <br>
   * 
   * @param dealerDepartmentId
   * @return
   */
  List<UserDealerDepartment> getUserDealerDepartmentAll(Long dealerDepartmentId);
  
  /**
	 * 递归查询部门树中的层级关系数据
	 * @param dealerDepartment 注意此部门需要包含完整的子部门信息
	 * @return
	 */
	List<UserDealerDepartment> getAllByTree(DealerDepartment dealerDepartment);
}
